﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace AJWPFAdmin.Services.Migrations
{
    /// <inheritdoc />
    public partial class 车辆信息新增排放阶段图片及其他调整 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "EmissionStandardImages",
                table: "ShippingRecords",
                type: "longtext",
                nullable: true,
                comment: "排放阶段图片Json数组文件路径")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<bool>(
                name: "InGoodsIsBulkCargo",
                table: "ShippingRecords",
                type: "tinyint(120)",
                maxLength: 120,
                nullable: true,
                comment: "进厂物资是否大宗");

            migrationBuilder.AddColumn<bool>(
                name: "OutGoodsIsBulkCargo",
                table: "ShippingRecords",
                type: "tinyint(1)",
                nullable: true,
                comment: "出厂物资是否大宗");

            migrationBuilder.AddColumn<string>(
                name: "Category",
                table: "Goods",
                type: "varchar(100)",
                maxLength: 100,
                nullable: true,
                comment: "物资分类")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<bool>(
                name: "IsBulkCargo",
                table: "Goods",
                type: "tinyint(1)",
                nullable: false,
                defaultValue: false,
                comment: "是否大宗货物");

            migrationBuilder.AddColumn<string>(
                name: "EmissionStandardImages",
                table: "Cars",
                type: "longtext",
                nullable: true,
                comment: "排放阶段图片Json数组文件路径")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1000,
                column: "StringValue",
                value: "{\"url\":\"\",\"companyName\":null,\"appId\":\"\",\"appSecret\":null,\"dbServer\":null,\"dbUserId\":null,\"dbPassword\":null,\"dbName\":null,\"apiDomain\":null,\"apiToken\":null,\"queryTemplate\":null,\"closeClientAPI\":false,\"accessToken\":null,\"accessTokenExpireDate\":null}");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "EmissionStandardImages",
                table: "ShippingRecords");

            migrationBuilder.DropColumn(
                name: "InGoodsIsBulkCargo",
                table: "ShippingRecords");

            migrationBuilder.DropColumn(
                name: "OutGoodsIsBulkCargo",
                table: "ShippingRecords");

            migrationBuilder.DropColumn(
                name: "Category",
                table: "Goods");

            migrationBuilder.DropColumn(
                name: "IsBulkCargo",
                table: "Goods");

            migrationBuilder.DropColumn(
                name: "EmissionStandardImages",
                table: "Cars");

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1000,
                column: "StringValue",
                value: "{\"url\":\"\",\"companyName\":\"\",\"dbServer\":null,\"dbUserId\":null,\"dbPassword\":null,\"dbName\":null,\"apiDomain\":null,\"apiToken\":null,\"queryTemplate\":null,\"closeClientAPI\":false}");
        }
    }
}
